package cn.zxf.note.common.web;

import org.springframework.web.server.ServerWebExchange;

import cn.zxf.note.security.SecurityConstant;

/**
 * Created by zengxf on 2019/3/27.
 */
public abstract class AbstractController implements SecurityConstant {

    protected Integer curUserId(ServerWebExchange ex) {
        String userId = ex.getRequest()
                .getHeaders()
                .getFirst(KEY_CUR_USER_ID);
        return userId == null ? null : Integer.valueOf(userId);
    }

}
